{include file='index/header' /}

<style>
/* 工具网格容器 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    max-width: 1024px;
    margin: 0 auto;
}

/* 工具卡片样式 */
.tool-card {
    background-color: var(--background-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    height: 100%;
    cursor: pointer;
    position: relative;
}

/* 工具卡片悬停效果 */
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* 点击效果 */
.tool-card:active {
    transform: translateY(-1px);
    transition: transform 0.1s ease;
}

/* 工具图标样式 */
.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-bottom: var(--spacing-md);
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

/* 工具名称样式 */
.tool-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-name {
    color: var(--primary-color);
}

/* 通知徽章样式 */
.notification-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin-left: var(--spacing-xs);
    animation: pulse 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 微光效果 */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.tool-card:hover::before {
    left: 100%;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .tool-icon {
        width: 50px;
        height: 50px;
    }
    
    .tool-card:hover {
        transform: translateY(-2px);
    }
}

/* 工具链接样式优化 */
.tool-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-link:hover {
    text-decoration: none;
    color: inherit;
}
</style>

<div class="tools-grid">
{foreach $list as $appInfo}
{if $appInfo['app_type'] == 0 || $appInfo['app_type'] == 2}
    {if $appInfo['open_type'] == 0}
    <a href="javascript:;" data-title="{$appInfo['app_name']}" data-url="{$appInfo['app_url']}" onclick="showFrameCustom(this, '{$appInfo[\'app_config\']}')" class="tool-link">
    {elseif condition="$appInfo['open_type'] eq 1" /}
    <a href="{$appInfo['app_url']}" class="tool-link">
    {else /}
    <a href="{$appInfo['app_url']}" target="_blank" class="tool-link">
    {/if}
        <div class="tool-card">
            <img class="tool-icon" src="{$appInfo['app_image']}" alt="{$appInfo['app_name']}" />
            <h3 class="tool-name">
                {$appInfo['app_name']}
                {if in_array($appInfo['remind_key'], $chatRemind['types'])}
                <span class="notification-badge"></span>
                {/if}
            </h3>
        </div>
    </a>
{/if}
{/foreach}
</div>

{include file='index/foot' /}